/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.suarte.core.service.impl;

import com.suarte.core.Company;
import com.suarte.core.Contact;
import com.suarte.core.Remission;
import com.suarte.core.RemissionDetail;
import com.suarte.core.dao.RemissionDao;
import com.suarte.core.service.RemissionManager;
import java.util.Date;
import org.appfuse.service.impl.GenericManagerImpl;

import java.util.List;

/**
 * @date   Dec 20, 2010
 * @author Ggutierrez
 */
public class RemissionManagerImpl extends GenericManagerImpl<Remission, Long> implements RemissionManager {
    RemissionDao remissionDao;

    public RemissionManagerImpl(RemissionDao workOrderDao) {
        super(workOrderDao);
        this.remissionDao = workOrderDao;
    }

    public List<Remission> findByDescription(String description) {
        return remissionDao.findByDescription(description);
    }

    public void store(Remission object) {
        remissionDao.store(object);
    }

    @Override
    public Remission get(Long id) {
        return remissionDao.get(id);
    }

    public void deleteDetails(List<RemissionDetail> args) {
        remissionDao.deleteDetails(args);
    }

    public void approve(Remission object) {
        remissionDao.save(object);
    }

    public List<Remission> findRemissions(Long id, Long quotationId, Long workOrderId, String description, Date date, Company company, Contact contact) {
        return remissionDao.findRemissions(id, quotationId, workOrderId, description, date, company, contact);
    }
}
